package team.sun.sss.dao.staff;

import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;
import team.sun.sss.pojo.staff.StaffTakeStudent;

import java.util.List;

@Mapper
@Repository
public interface StaffTakeStudentDao {

    @Select("select * from staff_take_student where sta_num=#{staNum}")
    List<StaffTakeStudent> getStaffTakeStudentById(String staNum);

    @Select("select * from staff_take_student")
    List<StaffTakeStudent> getStaffTakeStudentList();

    @Insert("insert into staff_take_student(tstu_grade,tstu_major,tstu_class,tstu_stistic,sta_num) values(#{tstuGrade},#{tstuMajor},#{tstuClass},#{tstuStistic},#{staNum})")
    int addStaffTakeStudent(StaffTakeStudent staffTakeStudent);

    @Update("update staff_take_student set tstu_grade = #{tstuGrade},tstu_major = #{tstuMajor},tstu_class = #{tstuClass},tstu_stistic = #{tstuStistic},sta_num = #{staNum} where tstu_id = #{tstuId}")
    int updateStaffTakeStudent(StaffTakeStudent staffTakeStudent);

    @Delete("delete from staff_take_student where tstu_id = #{tstuId}")
    int deleteStaffTakeStudent(@Param("tstuId") int id);


}
